package com.zy.edu.service;

import com.zy.edu.bean.InputParam;
import com.zy.edu.bean.User;
import com.baomidou.mybatisplus.service.IService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author HuangHaiShui
 * @since 2021-07-13
 */
public interface UserService extends IService<User> {
    //登录接口
    public Map oauth(String account, String password);

    public Map saveOrUpdate(User user,InputParam inputParam);
    public Map list(User user, InputParam inputParam);
    public Map dele(User user);

    public Map info( InputParam inputParam);

    /**
     * @Author: HuangHaiShui 
     * @Description:重置密码
     * @Date: 16:27 2021/7/20
     * @param inputParam: 
     * @return: Map
     **/
    public Map resetPass(InputParam inputParam);

    /**
     * @Author: HuangHaiShui 
     * @Description:修改密码
     * @Date: 16:27 2021/7/20
     * @param inputParam: 
     * @return: Map
     **/
    Map modifyPass(InputParam inputParam);

    /**
     * @Author: HuangHaiShui
     * @Description:头像上传
     * @Date: 16:29 2021/7/20
     * @param file:
     * @param inputParam:
     * @return: Map
     **/
    Map photo(MultipartFile file, InputParam inputParam) throws IOException;

    /**
     * @Author: HuangHaiShui
     * @Description:根据用户id 获取用户信息
     * 若是教师角色，还需要返回所在的班级信息
     * @Date: 16:28 2021/7/20
     * @param inputParam:
     * @return: Map
     **/
    Map getById(InputParam inputParam);


    /**
     * @Author: HuangHaiShui
     * @Description:根据班级id导出学生
     * @Date: 16:25 2021/7/20
     * @param inputParam:
     * @return: Map
     **/
    void exportByCid(HttpServletResponse response, InputParam inputParam) throws IOException;

    /**
     * @Author: HuangHaiShui
     * @Description:根据当前角色，获取能查询的老师信息
     * @Date: 13:59 2021/7/17
     * @param inputParam
     *                   userId:当前角色id
     *                   schoolId: 学校id
     * @return: Map
     **/
    Map getTeachers(InputParam inputParam);

    /**
     * @Author: HuangHaiShui
     * @Description:根据班级id查询学生
     * @Date: 16:25 2021/7/20
     * @param inputParam:
     * @return: Map
     **/
    Map getStuByClassId(InputParam inputParam);
    List<User> getStusByClassId(InputParam inputParam);

    Map importByCid(MultipartFile file, InputParam inputParam) throws IOException;

    Integer getCountByParam(InputParam inputParam);
    Integer getCountByClassId(String clsId);

    //根据班级id，查询教师
    List<User> getTeaByClsId(String clsId);

    void deleByJruisId(InputParam inputParam);
    void deleBySchoolId(InputParam inputParam);
    void deleByClsId(InputParam inputParam);
}
